<template>
  <div>
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="全部" name="first"></el-tab-pane>
      <el-tab-pane label="待审核" name="second"></el-tab-pane>
      <el-tab-pane label="已审核" name="third"></el-tab-pane>
      <el-tab-pane label="已拒绝" name="fourth"></el-tab-pane>
    </el-tabs>
    <tableCut ref="tableCut"></tableCut>
  </div>
</template>

<script>
import tableCut from '@/module-hmmm/pages/components/tableCut.vue'
export default {
  name: 'questions-choice-table',
  components: { tableCut },
  props: ['ruleForm'],
  data () {
    return {
      activeName: 'first'
    }
  },
  created () {},
  computed: {},
  methods: {
    // 获取列表信息

    getInfo () {
      const form = {}
      for (const i in this.ruleForm) {
        if (this.ruleForm[i] !== '') {
          form[i] = this.ruleForm[i]
        }
      }
      if (this.activeName === 'first') {
        this.$refs.tableCut.objList = {
          page: 1,
          pagesize: 10,
          ...form
        }
        this.$refs.tableCut.getChoice()
      }
      if (this.activeName === 'second') {
        this.$refs.tableCut.objList = {
          page: 1,
          pagesize: 10,
          ...form
        }
        this.$refs.tableCut.getChoice()
      }
      if (this.activeName === 'third') {
        this.$refs.tableCut.objList = {
          page: 1,
          pagesize: 10,
          ...form
        }
        this.$refs.tableCut.getChoice()
      }
      if (this.activeName === 'fourth') {
        this.$refs.tableCut.objList = {
          page: 1,
          pagesize: 10,
          ...form
        }
        this.$refs.tableCut.getChoice()
      }
    },
    // 切换栏
    handleClick (tab, event) {
      if (tab.paneName === 'first') {
        this.$refs.tableCut.objList = {
          page: 1,
          pagesize: 10
        }
        this.$refs.tableCut.getChoice()
      }
      if (tab.paneName === 'second') {
        this.$refs.tableCut.objList = {
          page: 1,
          pagesize: 10,
          chkState: 0
        }
        this.$refs.tableCut.getChoice()
      }
      if (tab.paneName === 'third') {
        this.$refs.tableCut.objList = {
          page: 1,
          pagesize: 10,
          chkState: 1
        }
        this.$refs.tableCut.getChoice()
      }
      if (tab.paneName === 'fourth') {
        this.$refs.tableCut.objList = {
          page: 1,
          pagesize: 10,
          chkState: 2
        }
        this.$refs.tableCut.getChoice()
      }
    }
  }
}
</script>

<style lang="scss" scoped></style>
